<template>
  <div>
    <iframe id="printIframe" ref="printIframe" frameborder="0" scrolling="no" style="margin: 0px;padding: 0px;width: 0px;height: 0px;" />
    <div ref="printDIV" style="display:none">
      <div
        v-for="(item, index) in printData"
        :key="index"
        style="width: 800px;height: auto;padding: 10px;font-size: 25px;
  page-break-after:always;display: flex;flex-direction: column;
  "
      >

        <table v-if="item.contractTemplate==='国外'" style="border-collapse:collapse;" width="100%">
          <tbody>
            <tr height="40px">
              <td rowspan="3" colspan="1" valign="center" style="font-weight:400;font-size: 10px;width:5655px;text-align:center;text-align: center"><img src="../../assets/images/export/huanyu1.png" style="object-fit: cover;width: 100%"></td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:700;font-size: 22px;width:7072px;text-align:center;">Wuxi Xishan Huanyu Metal Hose Co.,Ltd</td>
            </tr>
            <tr height="30px">
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 18px;width:7072px;text-align:center;">6 Ganbei Road ,Ganlu Ehu Town ,Xishan District ,Wuxi ,Jiangsu,China</td>
            </tr>
            <tr height="30px">
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 18px;width:7072px;text-align:center;">TEL: 86-510-88751037 FAX: 86-510-88751857</td>
            </tr>
            <tr height="30px">
              <td rowspan="1" colspan="5" valign="center" style="font-weight:700;font-size: 18px;width:5655px;text-align:center;border-bottom:solid #000000 1px;">Proforma Invoice</td>
            </tr>
            <tr height="40px">
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 10px;width:5655px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">To:</td>
              <td rowspan="2" colspan="2" valign="center" style="font-weight:400;font-size: 11px;width:7072px;text-align:left;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">{{ item.customerName }}</td>
              <td valign="center" style="font-weight:400;font-size: 9px;width:4033px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">NO.:</td>
              <td valign="center" style="font-weight:400;font-size: 10px;width:4352px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">{{ item.contractNo }}</td>
            </tr>
            <tr height="35px">
              <td valign="center" style="font-weight:400;font-size: 9px;width:4033px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">DATE:</td>
              <td valign="center" style="font-weight:400;font-size: 10px;width:4352px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">{{ dateFormat(item.contractDate) }}</td>
            </tr>
            <tr height="35px">
              <td valign="center" style="font-weight:700;font-size: 9px;width:5655px;text-align:left;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">TERMS OF PAYMENT:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 10px;width:7072px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">{{ item.paymentMethod }}</td>
            </tr>
            <tr height="35px">
              <td valign="center" style="font-weight:700;font-size: 9px;width:5655px;text-align:left;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">PORT OF LOADING:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 9px;width:7072px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">{{ item.shippingPort }}</td>
            </tr>
            <tr height="35px">
              <td valign="center" style="font-weight:700;font-size: 9px;width:5655px;text-align:left;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">PORT OF DISCHAGRE:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 10px;width:7072px;text-align:left;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">{{ item.targetPort }}</td>
            </tr>
            <tr height="35px">
              <td valign="center" style="font-weight:700;font-size: 9px;width:5655px;text-align:left;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">TIME OF DELIVERY:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 9px;width:7072px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">{{ item.deliveryDate }}</td>
            </tr>
            <tr height="30px">
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 11px;width:5655px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">Marks and Numbers</td>
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 11px;width:7072px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">Description of goods</td>
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 11px;width:3744px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">QUANTITY<br>({{ item.unit }})</td>
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 11px;width:4033px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">Unit Price<br>({{ item.priceUnitName }})</td>
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 11px;width:4352px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">Total Value<br>({{ item.priceUnitName }})</td>
            </tr>
            <tr height="5px" />
            <tr v-for="(item2,index2) in item.data" :key="index2" height="30px">
              <td v-if="index2===0" :rowspan="item.data.length+1" colspan="1" valign="center" style="font-weight:400;font-size: 10px;width:5655px;text-align:left;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;" />
              <td valign="center" style="font-weight:400;font-size: 11px;width:7072px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.model }}</td>
              <td valign="center" style="font-weight:400;font-size: 11px;width:3744px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.num }}</td>
              <td valign="center" style="font-weight:400;font-size: 11px;width:4033px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.singlePrice }}</td>
              <td valign="center" style="font-weight:400;font-size: 11px;width:4352px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.totalPrice }}</td>
            </tr>
            <tr height="30px">
              <td valign="center" style="font-weight:700;font-size: 11px;width:7072px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">TOTAL</td>
              <td valign="center" style="font-weight:700;font-size: 11px;width:3744px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;" />
              <td valign="center" style="font-weight:700;font-size: 11px;width:4033px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;" />
              <td valign="center" style="font-weight:700;font-size: 11px;width:4352px;text-align:center;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item.totalAmount }}</td>
            </tr>
            <tr height="30px">
              <td rowspan="1" colspan="5" valign="center" style="font-weight:700;font-size: 11px;width:5655px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;text-align: center">SAY TOTAL:  {{ item.priceUnitName }} {{ item.totalAmountEng }} ONLY</td>
            </tr>
            <tr height="30px">
              <td valign="center" style="font-weight:400;font-size: 11px;width:5655px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">BENEFICIARY:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 11px;width:7072px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">Agricultural Bank of China Jiangsu Branch,P.R China</td>
            </tr>
            <tr height="30px">
              <td valign="center" style="font-weight:400;font-size: 11px;width:5655px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">Swift Bic:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 11px;width:7072px;text-align:left;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">ABOCCNBJ100</td>
            </tr>
            <tr height="30px">
              <td valign="center" style="font-weight:400;font-size: 11px;width:5655px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">ACCOUNT NUMBER:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 11px;width:7072px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">10650114040003685</td>
            </tr>
            <tr height="30px">
              <td valign="center" style="font-weight:400;font-size: 11px;width:5655px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">Company Name:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 11px;width:7072px;text-align:left;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">WuxiXishanHuanyuMetalHoseCo.,Ltd</td>
            </tr>
            <tr height="30px">
              <td valign="center" style="font-weight:400;font-size: 11px;width:5655px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">Address:</td>
              <td rowspan="1" colspan="4" valign="center" style="font-weight:400;font-size: 11px;width:7072px;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;padding-left: 10px">6 Ganbei Road, Ganlu, Ehu Town, Xishan District, Wuxi, Jiangsu, China</td>
            </tr>
          </tbody>
        </table>

        <table v-if="item.contractTemplate==='国内'" style="border-collapse:collapse;" width="100%">
          <tbody>
            <tr height="100px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:700;font-size: 30px;width:4922px;text-align:center;color:#000000;letter-spacing: 20px">购销合同</td>
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;">合 同 号：</td>
              <td rowspan="1" colspan="2" valign="center" style="font-weight:400;font-size: 18px;width:4922px;color:#000000;">{{ item.contractNo }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;">签定时间：</td>
              <td rowspan="1" colspan="2" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">{{ item.contractDate }}</td>
            </tr>
            <tr height="30px">
              <td rowspan="1" colspan="3" valign="center" style="font-weight:400;font-size: 11px;width:4922px;text-align:left;color:#000000;" />
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;">签定地点：</td>
              <td rowspan="1" colspan="2" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">无锡</td>
            </tr>
            <tr height="30px">
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;">卖 方：</td>
              <td rowspan="1" colspan="5" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">无锡市锡山环宇金属软管有限公司</td>
            </tr>
            <tr height="30px">
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;">买 方：</td>
              <td rowspan="1" colspan="5" valign="center" style="font-weight:400;font-size: 18px;width:4922px;color:#000000;">{{ item.customerName }}</td>
            </tr>
            <tr height="30px">
              <td rowspan="1" colspan="6" valign="center" style="font-weight:400;font-size: 11px;width:4922px;text-align:left;color:#000000;border-bottom:solid #000000 1px;" />
            </tr>
            <tr height="30px">
              <td rowspan="1" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">兹经甲乙双方共同协商，就甲方购进，乙方出售下列货物，达成如下友好协议：</td>
            </tr>
            <tr height="30px">
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">一、货物内容： </td>
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">货物名称:</td>
              <td rowspan="2" colspan="1" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">{{ item.materialName }}</td>
              <td rowspan="2" colspan="3" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;" />
            </tr>
            <tr height="5px" />
            <tr height="30.0px">
              <td valign="center" style="font-weight:400;font-size: 16px;width:6000px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">规 格（内径*长度）</td>
              <td valign="center" style="font-weight:400;font-size: 16px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">结构</td>
              <td valign="center" style="font-weight:400;font-size: 16px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">单价（元/含税）</td>
              <td valign="center" style="font-weight:400;font-size: 16px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">数量（个）</td>
              <td valign="center" style="font-weight:400;font-size: 16px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">总金额（元）</td>
              <td valign="center" style="font-weight:400;font-size: 16px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">备 注</td>
            </tr>
            <tr v-for="(item2,index2) in item.data" :key="index2" height="30px">
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.model }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.structure }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.singlePrice }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.num }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.totalPrice }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item2.remark }}</td>
            </tr>
            <tr height="30px">
              <td rowspan="1" colspan="2" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">合 计</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;" />
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item.totalNum }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;">{{ item.totalAmount }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:center;color:#000000;border-top:solid #000000 1px;border-right:solid #000000 1px;border-bottom:solid #000000 1px;border-left:solid #000000 1px;" />
            </tr>
            <tr height="10px" />
            <tr height="30px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">二、品质要求：根据客户要求生产；</td>
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">三、包装方式：透明塑料袋包装外加牛皮纸箱。</td>
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">四、运输方式：由乙方承担，物流。；</td>
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">五、交货时间：下单后20个工作日；</td>
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">六、付款方式：买卖双方合同签订确认后，预付30%货款，款到安排生产，付清全款后发货，同时提供等额增值税税票。</td>
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">七、其它条款：</td>
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">八、解决合同纠纷的方式：如本合同在履行中发生争议，双方应协商解决，协商不成时，提交法院解决。</td>
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">九、本合同一式两份，双方签字盖章后生效并具有同等法律效力。（传真确认亦具有同等法律效力）</td>
            </tr>
            <tr height="5px" />
            <tr height="88.0px">
              <td rowspan="1" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">
                十、付款资料：<br>
                <br><label style="font-weight: bold;font-size: 24px">名称：无锡市锡山环宇金属软管有限公司</label>
                <br><label style="font-weight: bold;font-size: 24px">统一社会信用代码：91320205722277642W</label>
                <br><label style="font-weight: bold;font-size: 24px">地址、电话：无锡市锡山区鹅湖镇甘露翰林路 5 号/0510-88751037</label>
                <br><label style="font-weight: bold;font-size: 24px">开户行及帐号：农行无锡甘露支行 10651101040002238</label>
              </td>
            </tr>
            <tr height="10px">
              <td rowspan="2" colspan="6" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;" />
            </tr>
            <tr height="5px" />
            <tr height="30px">
              <td rowspan="1" colspan="3" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">卖方：</td>
              <td rowspan="4" colspan="1" valign="center" style="font-weight:400;font-size: 11px;width:4922px;text-align:center;color:#000000;" />
              <td rowspan="1" colspan="2" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">买方：</td>
            </tr>
            <tr height="30px">
              <td rowspan="2" colspan="3" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;border-bottom:solid #000000 1px;">无锡市锡山环宇金属软管有限公司</td>
              <td rowspan="2" colspan="2" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;border-bottom:solid #000000 1px;">{{ item.customerName }}</td>
            </tr>
            <tr height="10px" />
            <tr height="40px">
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">{{ item.contractDate }}</td>
              <td rowspan="1" colspan="2" valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">联系电话：1377117371</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;">{{ item.contractDate }}</td>
              <td valign="center" style="font-weight:400;font-size: 18px;width:4922px;text-align:left;color:#000000;" />
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'PrintSaleOrder',
  props: {
    printData: {}
  },
  data() {
    return {
    }
  },
  watch: {
    printData(val) {
      console.log(val)
      if (val.length > 0) {
        setTimeout(() => {
          this.print()
        }, 200)
      }
    }
  },
  mounted() {

  },
  methods: {
    print() {
      // // 拿到要打印区域的dom结构并设置到Iframe的srcdoc属性上面
      var printIframe = this.$refs.printIframe
      var newstr = this.$refs.printDIV.innerHTML
      printIframe.setAttribute('srcdoc', newstr)
      printIframe.onload = function() {
      // 去掉iframe里面的dom的body的padding margin的默认数值
        printIframe.contentWindow.document.body.style.padding = '0px'
        printIframe.contentWindow.document.body.style.margin = '0px'
        // 开始打印
        printIframe.contentWindow.focus()
        printIframe.contentWindow.print()
      }
    },
    print2() {
    },
    dateFormat(val) { // 日期格式化成英文显示 Jan 04, 2022
      if (!val) {
        return ''
      }
      const date = new Date(val)
      const chinaDate = date.toDateString()
      const chinaDateArray = chinaDate.split(' ')
      const displayDate = `${chinaDateArray[1]} ${chinaDateArray[2]}, ${chinaDateArray[3]}`
      return displayDate
    }
  }
}
</script>
<style scoped>

</style>
